package org.chen.user.service.impl;

import org.chen.spring.core.annotation.Autowired;
import org.chen.spring.core.annotation.Service;
import org.chen.user.domain.UserDomain;
import org.chen.user.mapper.UserMapper;
import org.chen.user.service.UserService;

/**
 * @author Chen
 * @since 2023/6/7 13:13
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public UserDomain findUserById(String id) {
        return userMapper.getById(id);
    }

    @Override
    public boolean addUser(String phone, String password, String nickname) {
        int i = userMapper.insert(phone, password, nickname);
        return i > 0;
    }
}
